//
// Created by root on 2020/5/3.
//

#ifndef HEATBEATSERVER_ROOMMGR_H
#define HEATBEATSERVER_ROOMMGR_H

#include <muduo/base/Singleton.h>
#include "Room.h"

class CRoomMgr {
public:
    CRoomMgr();
    ~CRoomMgr();

    void CreateRoom(const std::string &_csInitiator, const std::string &_csReceiver);

    void CloseRoom(const std::string &_csRoomId);

    void CloseRoom(const std::string &_csClientId1, const std::string &_csClientId2);

    std::set<std::string> RemoveAndGetChater(const std::string &_csName);

    bool IsContain(const std::string &_csClientId1, const std::string &_csClientId2);

private:
    std::set<CRoom> m_setP2PChatRoom;
};

using gRoomMgr = muduo::Singleton<CRoomMgr>;

#endif //HEATBEATSERVER_ROOMMGR_H
